package com.pine.dbant.core.web;

import com.pine.dbant.core.model.dto.FunctionParamDTO;
import com.pine.dbant.core.service.MetadataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author xiaoyuan
 * @create 2022/11/30 9:12
 **/
@Api(tags = "元数据服务")
@RestController
@RequestMapping("/metadata")
public class MetadataController extends BaseHandler {

    @Autowired
    private MetadataService metadataService;


    /**
     * 查询函数
     * @param functionParamDTO
     * @return
     */
    @ApiOperation("查询函数")
    @PostMapping("/executeFunction")
    public Object executeFunction(@Valid @RequestBody FunctionParamDTO functionParamDTO) {
        return metadataService.executeFunction(functionParamDTO);
    }

}
